home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_091 / include / builtins.h < prev    next >
Text File  |  1992-05-06  |  5KB  |  120 lines

  1. /*    builtins.h -- values for built in functions */
  2.  
  3. /* Object functions */
  4.  
  5. #define _LOC         -1    /* ($loc OBJ) container of OBJ */
  6. #define    _CONT         -2    /* ($cont OBJ) First item contained in OBJ */
  7. #define    _LINK         -3    /* ($link OBJ) Next obj in same node as OBJ */
  8. #define    _LDESC         -4    /* ($ldesc OBJ) LDesc of OBJ */
  9. #define _SDESC         -5    /* ($sdesc OBJ) SDesc of OBJ */
  10. #define _ACTION         -6    /* ($action OBJ) Action routine for OBJ */
  11. #define    _PROP         -7    /* ($prop OBJ NUM) NUM'th prop of OBJ */
  12. #define _SETP         -8    /* ($setp OBJ NUM VAL) OBJ(NUM) = VAL */
  13. #define _MOVE         -9    /* ($move OBJ1 OBJ2)  move OBJ1 to OBJ2 */
  14. #define _MODIF        -10    /* ($modif OBJ) modifier of OBJ -
  15.                    if < 0, it is a verb; if > 0 it
  16.                    is an adjec, otherwise, it's null */
  17.  
  18. /* Verb functions */
  19.  
  20. #define    _VSET        -11    /* ($vset VERB PROP VAL) VERB(PROP) = VAL */
  21. #define _VPROP        -12    /* ($vprop VERB PROP)     returns VERB(PROP) */
  22.  
  23. /* Arithmetic functions */
  24.  
  25. #define _PLUS        -13    /* ($plus A B) A + B */
  26. #define _MINUS        -14    /* ($minus A B) A - B */
  27. #define _TIMES        -15    /* ($times A B) A * B */
  28. #define _DIV        -16    /* ($div A B) A / B */
  29. #define _MOD        -17    /* ($mod A B) A % B */
  30. #define _RAND        -18    /* ($rand N) Random # from 1 to N, inclusive */
  31.  
  32. /* Boolean functions */
  33.  
  34. #define _AND        -19    /* ($and A B) A & B */
  35. #define _OR        -20    /* ($or A B) A | B */
  36. #define _NOT        -21    /* ($not N) 1 if N==0, 0 otherwise */
  37. #define _YORN        -22    /* ($yorn) (user input)[0] in [ 'y', 'Y' ] */
  38. #define _PCT        -23    /* ($pct N) 1 N% of the time */
  39. #define _EQ        -24    /* ($eq A B) A == B */
  40. #define _NE        -25    /* ($ne A B) A != B */
  41. #define _LT        -26    /* ($lt A B) A < B */
  42. #define _GT        -27    /* ($gt A B) A > B */
  43. #define _LE        -28    /* ($le A B) A <= B */
  44. #define _GE        -29    /* ($ge A B) A >= B */
  45.  
  46. /* Miscellaneous Routines */
  47.  
  48. #define _SAY        -30    /* ($say A B ...) printf( "%s%s...", A,B,...)*/
  49. #define _ARG        -31    /* ($arg N) Nth arg to this routine */
  50. #define _EXIT        -32    /* ($exit N) pop stack; if N !=0 next turn */
  51. #define _RETURN        -33    /* ($return V) pop stack, retval = V */
  52. #define _VAL        -34    /* ($val E) returns E */
  53. #define _PHASE        -35    /* ($phase) returns current phase # */
  54. #define _SPEC        -36    /* ($spec CODE A B C ...) perform one of:
  55.                    CODE = 1, Toggle debugging mode
  56.                    CODE = 2, Restart this run of ADL
  57.                    CODE = 3, Terminate this run of ADL
  58.                    CODE = 4, Save the game
  59.                    CODE = 5, Restore a game
  60.                    CODE = 6, Execute a program A with args B...
  61.                    CODE = 7, Set the unknown words file
  62.                    CODE = 8, Set script file
  63.                    CODE = 9, Write a header
  64.                    CODE = 10, Set left & right margins
  65.                 */
  66.  
  67. /* Global-value functions */
  68.  
  69. #define _SETG        -37    /* ($setg VAR VAL) (VAR) = VAL */
  70. #define _GLOBAL        -38    /* ($global VAR) @VAR */
  71. #define _VERB        -39    /* ($verb) @Verb */
  72. #define _DOBJ        -40    /* ($dobj) @Dobj */
  73. #define _IOBJ        -41    /* ($iboj) @Iobj */
  74. #define _PREP        -42    /* ($prep) @Prep */
  75. #define _CONJ        -43    /* ($conj) @Conj */
  76. #define _NUMD        -44    /* ($numd) @Numd */
  77.  
  78. /* Transition procedures */
  79.  
  80. #define _SETV        -45    /* ($setv V1 .. V10) VECVERB = V1 .. V10 */
  81. #define _HIT        -46    /* ($hit OBJ D1 .. D10)
  82.                     ($move OBJ D[ pos( @Verb, VECVERB )) */
  83. #define _MISS        -47    /* ($miss R1 .. R10)
  84.                     eval( R[ pos( @Verb, VECVERB ) ) */
  85.  
  86. /* String functions */
  87.  
  88. #define _EQST        -48    /* ($eqst A B) returns strcmp( A, B ) == 0 */
  89. #define _SUBS        -49    /* ($subs S P N) returns copy( S, P, N ) */
  90. #define _LENG        -50    /* ($leng S) returns length( S ) */
  91. #define _CAT        -51    /* ($cat S1 S2) returns strcat( S1, S2 ) */
  92. #define _POS        -52    /* ($pos S1 S2) returns strpos( S1, S2 ) */
  93. #define _CHR        -53    /* ($chr N) returns '\NNN' */
  94. #define _ORD        -54    /* ($ord S) returns (int16) S[ 0 ] */
  95. #define _READ        -55    /* ($read) returns user input string */
  96. #define _SAVESTR    -56    /* ($savestr S) saves S in perm. area */
  97. #define _NAME        -57    /* ($name OBJ) returns (2 word) name of OBJ */
  98. #define _VNAME        -58    /* ($vname VERB) returns name of VERB */
  99. #define _MNAME        -59    /* ($mname MODIF) returns name of MODIF */
  100. #define _PNAME        -60    /* ($pname PREP) returns name of PREP */
  101. #define _DEFINE        -61    /* ($define a b) expands a to b at runtime */
  102. #define _UNDEF        -62    /* ($undef S) undefines S */
  103. #define _STR        -63    /* ($str N) returns the ascii value of N */
  104. #define _NUM        -64    /* ($num S) returns numeric value of S */
  105.  
  106. /* Demons, fuses, and actors */
  107.  
  108. #define _SDEM        -65    /* ($sdem R) activates R as a demon */
  109. #define _DDEM        -66    /* ($ddem R) deactivates R as a demon */
  110. #define _SFUS        -67    /* ($sfus R N) Activates R as a fuse,
  111.                     burning down in N turns */
  112. #define _DFUS        -68    /* ($dfus R) Quenches R as a fuse */
  113. #define _INCTURN    -69    /* ($incturn) Increment the turn counter */
  114. #define _TURNS        -70    /* ($turns) Current val. of turn counter */
  115. #define _PROMPT        -71    /* ($prompt R) Sets R as the prompt routine */
  116. #define _ACTOR        -72    /* ($actor OBJ STR FLAG) new actor */
  117. #define _DELACT        -73    /* ($delact OBJ) Deletes actor OBJ */
  118.  
  119. /*** EOF builtins.h ***/
  120.